package com.szholly.pro.watergas_server.ps.data;

import java.util.HashMap;

import com.szholly.data.general.metadata.table.DefulatDomainTable;import org.springframework.stereotype.Component;import com.szholly.data.general.Field;import com.szholly.data.general.InterceptorTableBase;import com.szholly.data.general.metadata.IBaseTable;import com.szholly.utils.spring.SpringBeanFactory;import org.springframework.stereotype.Component;import com.szholly.data.general.GlobalDataType;import com.szholly.data.general.RowBase;
/**
 * Project
 */
@Component("Project")
public class ProjectTable extends InterceptorTableBase  implements IBaseTable{

	public final static String TABLE_NAME = "PROJECT";
	
	/**
	 * single ref
	 */
	public static ProjectTable getSingleRef() {
		return (ProjectTable) SpringBeanFactory.getBean("Project");
	}

	@Override
	public String getMetadataTableName() {
		return TABLE_NAME;
	}

	@Override
	public String getMetadataTableAliasName() {
		return "Project";
	}

	private HashMap<String, Field> fields;

	@Override
	protected HashMap<String, Field> fields() {
		if (fields == null) {
			fields = new HashMap<String, Field>();

			Field itemField = new Field();
			itemField.setFieldName(RowBase.FIELD_GUID);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(1);
			itemField.setFieldAliasName("GUID");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(ProjectRow.FIELD_ProjectDept);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(4);
			itemField.setFieldAliasName("PROJECT_DEPT");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(ProjectRow.FIELD_StartTime);
			itemField.setDataType(GlobalDataType.Date);
			itemField.setFieldID(6);
			itemField.setFieldAliasName("START_TIME");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(ProjectRow.FIELD_EndTime);
			itemField.setDataType(GlobalDataType.DateTime);
			itemField.setFieldID(7);
			itemField.setFieldAliasName("END_TIME");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(ProjectRow.FIELD_IsNewBuild);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(8);
			itemField.setFieldAliasName("IS_NEW_BUILD");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(ProjectRow.FIELD_Note);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(9);
			itemField.setFieldAliasName("NOTE");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(ProjectRow.FIELD_ProjectNo);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(10);
			itemField.setUniqueGroup("PROJECTNO");
			itemField.setFieldAliasName("项目编号");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(ProjectRow.FIELD_ReportFile);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(11);
			itemField.setFieldAliasName("REPORT_FILE");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(ProjectRow.FIELD_DetectionCompany);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(12);
			itemField.setFieldAliasName("DETECTION_COMPANY");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(ProjectRow.FIELD_ProjectName);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(13);
			itemField.setFieldAliasName("PROJECT_NAME");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
		}
		return fields;
	}

	@Override
	public String getTableGroup() {
		return "Project";
	}
}